package com.zzz.mcpservice.service;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;


@Service
public class TestService {
    private static final Logger log = LoggerFactory.getLogger(TestService.class);
    @Tool(description = "用于回答Java内容")
    public String testJava(String input) {
        log.info("Java相关执行。。。。。。。。。。。。");
        return "Java=====hello world"+input;
    }

    @Tool(description = "用于回答Python内容")
    public String testPython(String input) {
        log.info("Python相关执行。。。。。。。。。。。。");
        return "Python---hello world"+input;
    }

    @Tool(description = "用于获取教材数据")
    public String getBookInfo(String input) {
        log.info("获取教材数据执行。。。。。。。。。。。。");
        return "教材A，教材B，教材D";
    }

    @Tool(description = "根据城市名获取天气信息")
    public String getWeather(String cityName) {
        log.info("获取天气信息执行。。。。。。。。。。。。");
        return cityName+"天气为大晴天，100摄氏度。";
    }

    @Tool(description = "加法方法")
    public Integer add(Integer a, Integer b) {
        log.info("===============add方法被调用: a={}, b={}", a, b);
        return a + b;
    }

    @Tool(description = "乘法方法")
    public Integer multiply(Integer a, Integer b) {
        log.info("===============multiply方法被调用: a={}, b={}", a, b);
        return a * b;
    }
}
